<template>
  <view class="content">
    <text style="font-size: 50rpx; font-weight: bold;">子组件A</text>
    <view class="coma_box" style="margin: 20rpx 0; padding: 20rpx; background: #f5f5f5;">
      <text>父组件传进来的值:</text>
      <text style="font-weight: bold; color: red; margin-left: 10rpx;">{{ intent }}</text>
    </view>
    <button type="primary" @click="sendData()" style="width: 80%; margin: 0 auto;">传值给CompB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  data() {
    return {}
  },
  methods: {
    sendData() {
      console.warn("----子A发送给子B的值-->", this.intent);
      uni.$emit('getIntent', this.intent);
    }
  }
}
</script>

<style scoped>
.content {
  padding: 20rpx;
  background: #fff;
  border-radius: 10rpx;
  margin: 0 20rpx;
}
</style>